<header>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark container-fluid px-3">

           <div>
               <a class="navbar-brand" href="{{route('base.home')}}">Message board</a>
           </div>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse justify-content-end mx-4 text-secondary" id="navbarNavDropdown">
            <ul class="navbar-nav">
                <li class="nav-item dropdown">
                    @if(Auth::check())
                            <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">{{Auth::user()->name}}</a>
                            <div class="dropdown-menu text-center" style="font-size: 14px">
                                <a class="dropdown-item" href="{{route('users.show',Auth::user())}}">个人中心</a>
                                <a class="dropdown-item" href="{{route('users.edit',Auth::user())}}">编辑资料</a>
                                <a class="dropdown-item" href="{{route('users.index')}}">会员列表</a>
                                <div class="dropdown-divider"></div>
                                <div class="d-flex justify-content-center">
                                    <form action="{{route('auth.logout')}}" method="post">
                                        @csrf
                                        @method('delete')
                                        <button class="btn btn-danger btn-sm">退出登录</button>
                                    </form>
                                </div>
                        </div>
                    @else
                        <a class="nav-link" href="{{route('login')}}">登录</a>
                    @endif
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{route('base.help')}}">帮助</a>
                </li>
            </ul>
        </div>
    </nav>
</header>
